package cn.labbook.bluetooth.util.p645;

import lombok.extern.slf4j.Slf4j;


/**
 * Created by Administrator on 2018/12rr/10.
 */
@Slf4j
public class Protocol645BuildUtils {

    public static Protocol645 build(String address, byte control, byte[] data) {
        Protocol645 protocol645 = new Protocol645();
        BCD bcd = new BCD(6);
        bcd.fromBCDString(address);
        protocol645.setAddress(bcd.getCodeBytes());
        protocol645.setControl(control);
        protocol645.setData(data);
        protocol645.setL((byte) data.length);
        return protocol645;
    }
}
